//
//  EnterOnlyImageTableViewCell.m
//  ToWhere
//
//  Created by dllo on 15/11/25.
//  Copyright © 2015年 www.TE.com. All rights reserved.
//

#import "EnterOnlyImageTableViewCell.h"
#import <SDWebImageManager.h>
#import <UIImageView+WebCache.h>

@interface EnterOnlyImageTableViewCell()

@property(nonatomic, retain) UIImageView *bigImage;

@end

@implementation EnterOnlyImageTableViewCell

- (void)dealloc
{
    [_bigImage release];
    [_imageName release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.bigImage = [[UIImageView alloc]init];
        [self.contentView addSubview:self.bigImage];
        [_bigImage release];
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.bigImage.frame = CGRectMake(10 * kWidth, 10 * kHeight, self.frame.size.width - 20 * kWidth, 180 * kHeight);
}


-(void)setImageName:(NSString *)imageName
{
    if (_imageName != imageName) {
        [_imageName release];
        _imageName = [imageName copy];
    }
    [self.bigImage sd_setImageWithURL:[NSURL URLWithString:imageName] placeholderImage:[UIImage imageNamed:@"placeHoder"]];
}

@end
